<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    console.log("===switch 循环===")
    var grade = prompt("请输入你的成绩")
    switch (true){
        case 90 <= grade && grade <= 100:
            console.log(grade + "分，成绩评为A")
            break
        case 80 <= grade && grade < 90:
            console.log(grade + "分，成绩评为B")
            break
        case 70 <= grade && grade < 80:
            console.log(grade + "分，成绩评为C")
            break
        case 60 <= grade && grade < 70:
            console.log(grade + "分，成绩评为D")
            break
        case 0 <= grade && grade < 60:
            console.log(grade + "分，成绩评为D")
            break
        default:
            console.log(grade + "分，该成绩无效")
            break
    }
</script>
</html>